query process in data base